package com.yelink.metrics.api.dto;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.yelink.metrics.core.constant.enums.FrequencyUnit;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 指标 入参
 * @author idea
 */
@Data
@Builder
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class TargetDTO {

    /**
     * 模型编码
     */
    private String modelCode;

    @JsonIgnore
    private Integer modelId;
    /**
     * 模型名称
     */
    private String modelName;

    /**
     * 指标名
     */
    private String targetName;

    /**
     * 指标中文名
     */
    private String targetCname;

    /**
     * 方法名
     */
    private String methodName;
    /**
     * 方法中文名
     */
    private String methodCname;

    private String dataSourceType;

    private String sql;
    /**
     * 数据库
     */
    private String tableSchema;

    /**
     * 表名
     */
    private String tableName;

    private FrequencyUnit frequencyUnit;

    private Integer frequency;

    public String buildTargetUniCode() {
        return this.targetName + "_" + this.modelId;
    }


}
